package com.luych.toolbox.data.service.dao;

import com.luych.toolbox.common.enums.DataSourceType;
import com.luych.toolbox.data.service.entity.DataAgent;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Optional;

public interface DataAgentDao extends JpaRepository<DataAgent, String>, JpaSpecificationExecutor<DataAgent> {

    Optional<DataAgent> findByName(String name);

    Page<DataAgent> findByNameLikeOrHostLike(String name, String host, Pageable pageable);

    Page<DataAgent> findByType(DataSourceType type, Pageable pageable);

}